<?php
namespace app\common\model;

use think\model\concern\SoftDelete;

class ApplyExpenses extends Base
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';

    public function getImgAttr($val)
    {
        if(empty($val)) return [];

        $imgs = json_decode($val, true);

        $url = getUrl();

        foreach ($imgs as &$value) {
            $value = $url . $value;
        }

        return $imgs;
    }

    public function getFinishTimeAttr($val)
    {
        if(!$val) return '';
        return date('Y-m-d H:i:s', $val);
    }
}